﻿@model BCDto.FMIS.Certificate.AccountCertificate.AccountCertificateDto
@{
    Layout = null;
}


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    @{
        for (int i = 0; i < Model.AccountCertificateFlows.Count / 5; i++)
        {
            @if (i % 2 == 1)
            {
                <div style="height:100px;">
                    <span style="float:left;width:50px;border-top:1px solid #333;margin-top:50px;"></span>
                    <span style="float:right;width:50px;border-top:1px solid #333;margin-top:50px"></span>
                </div>
            }
            @if (i > 0 && i % 2 == 0)
            { 
                <div style="page-break-after:always;"></div>
            }

            <div style="width: 800px;margin: 0 auto;line-height: 35px;">
                <div style="padding: 10px 0;">
                    <div style="width: 30%;display: inline-block;"></div>
                    <div style="width: 30%;text-align: center;display: inline-block;">
                        <span style="font-size: 40px;">记账凭证</span>
                    </div>
                    <div style="width: 30%;text-align: right;display: inline-block;float:right;">
                        <span style="margin-top:10px;">附件单据: @Model.AccountReceiptCount </span>
                    </div>
                </div>
                <div style="padding: 10px 0;">
                    @*<div style="width: 30%;text-align: left;display: inline-block;">
                            <span>单位：@Model.CompanyName</span>
                        </div>*@
                    <div style="width: 30%;text-align: left;display: inline-block;">
                        <span>日期： @Model.Year-@Model.Month-@Model.Day</span>
                    </div>
                    <div style="width: 30%;text-align: right;display: inline-block;float:right;">
                        @if (Model.AccountCertificateFlows.Count <= 5)
                        {
                            <span>凭证号：@Model.AccountCertificateNumber</span>
                        }
                        else
                        {
                            <span>凭证号：@Model.AccountCertificateNumber  ( @(i + 1) / @(Model.AccountCertificateFlows.Count() / 5) )</span>
                        }
                    </div>
                </div>
                <table border="1" style="border-collapse: collapse;width:100%;">
                    <tr style="text-align: center;">
                        <td>摘要</td>
                        <td>科目</td>
                        <td>借方金额</td>
                        <td>贷方金额</td>
                    </tr>
                    @for (int m = 0; m < 5; m++)
                    {
                        int fNo = i * 5 + m;
                        <tr style="height:55px;">
                            <td>@Model.AccountCertificateFlows[fNo].Summary</td>
                            <td>@Model.AccountCertificateFlows[fNo].AccountNo   @Model.AccountCertificateFlows[fNo].AccountName </td>
                            @if (@Model.AccountCertificateFlows[fNo].HandleDirection == @BCCommon.FMISEnums.DirectionType.Debit)
                            {
                                <td style="text-align:right">@string.Format("{0:N}", Model.AccountCertificateFlows[fNo].BorrowerAmount )</td>
                                <td></td>
                            }
                            else
                            {
                                <td></td>
                                <td style="text-align:right">@string.Format("{0:N}", Model.AccountCertificateFlows[fNo].LenderAmount )</td>
                            }
                        </tr>
                    }
                    <tr  style="height:55px;">
                        <td colspan="2">合计: @Model.ChineseAmountSum</td>
                        <td style="text-align:right">@string.Format("{0:N}", Model.BorrowerAmountSum)</td>
                        <td style="text-align:right">@string.Format("{0:N}", Model.LenderAmountSum)</td>
                    </tr>
                </table>
                <div style="padding: 10px 0;">
                    <div style="width: 19%;text-align: left;display: inline-block;">
                        <span>主管: </span>
                    </div>
                    <div style="width: 19%;text-align: left;display: inline-block;">
                        <span>记账: </span>
                    </div>
                    <div style="width: 19%;text-align: left;display: inline-block;">
                        <span>审核: @Model.ValidationAdminFullName</span>
                    </div>
                    <div style="width: 19%;text-align: left;display: inline-block;">
                        <span>出纳</span>
                    </div>
                    <div style="width: 19%;text-align: left;display: inline-block;">
                        <span>制单: @Model.EditerFullName</span>
                    </div>
                </div>
            </div>
        }

    }
</body>
</html> 